package com.hall.utils;

import com.hall.dao.DoctorAppraiseMapper;
import com.hall.pojo.DoctorAppraise;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContext;
import java.util.List;

public class FNSutils {


    private static DoctorAppraiseMapper appraiseDao = SpringContextHolder.getBean("doctorAppraiseMapper");
    //判断评价用户是否已经评价过此专家，评价用户id,当前会诊id,当前专家id
    public  static boolean isAppraise(String userId,String appointmentId,String sysUserId){
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+(appraiseDao==null));
        DoctorAppraise doctorAppraise=new DoctorAppraise();
        doctorAppraise.setUserId(userId).setAppointmentId(appointmentId).setSysUserId(sysUserId);
         List<DoctorAppraise> doctorAppraiseList=appraiseDao.findList(doctorAppraise);
         if(doctorAppraiseList.size()>0){
             return true;
         }
         return  false;
    }
}
